$main-color: #0259b3;
$gray: #eee;
$dark: #1d2e38;

html {
    height: 100%;
    overflow: hidden;
    font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "\5FAE\8F6F\96C5\9ED1", Arial, sans-serif;
}
*, *::before, *::after {
    box-sizing: border-box;
}
input {
    color: $main-color;
    -webkit-appearance: none;
}
input::-webkit-input-placeholder {
    font-weight: 300;
    color: $main-color;
}
button,
a.btn,
input[type=button] {
    font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "\5FAE\8F6F\96C5\9ED1", Arial, sans-serif;
    border: 0;
    background: lighten($color: $main-color, $amount: 20);
    color: rgba($color: #fff, $alpha: .8);
    font-size: 16px;
    padding: 0 10px;
    outline: none;
    font-weight: 300;
    border-radius: 0;
    &:hover {
        background-color: lighten($color: $main-color, $amount: 10);
        color: rgba($color: #fff, $alpha: .5);
    }
}
a.btn {
    display: flex;
    align-items: center;
    text-decoration: none;
}
body {
    height: 100%;
    padding: 0;
    margin: 0;
    overflow: hidden;
    
}
main {
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: $main-color;
    overflow: hidden;
    &.dragover::before  {
        color: rgba(255,255,255,.5);
    }
    &::before {
        content: 'Paste/Click/Drag image or url';
        color: rgba(255,255,255,.2);
        font-weight: 900;
        font-size: 3vw;
        position: absolute;
        top: 50%;
        width: 100%;
        text-align: center;
        transform: translateY(-50%);
    }
}
.inputField {
    width: 100%;
    height: 100%;
    flex: 1;
    opacity: 0;
}
.content {
    // display: none;
    display: flex;
    height: 100%;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9;
    align-items: stretch;
    section {
        flex: 1;
    }
    .img {
        display: flex;
        justify-content: center;
        align-items: center;
        background-color: $dark;
        transform-origin: bottom right;
    }
    .text {
        transform-origin: bottom left;
        height: 100%;
        background-color: #fff;
        font-size: 15px;
        line-height: 2;
    }
    .control {
        width: 100%;
        background: $main-color;
        display: flex;
        justify-content: flex-end;
        button {
            background: none;
            padding: 0;
        }
        img {
            box-shadow: none;
            width: 40px;
            height: 40px;
            opacity: .2;
            // background: #000;
            padding: 8px;
            &:hover {
                background-color: rgba($color: #000000, $alpha: .2);
                opacity: 1;
            }
        }
    }
    .img,
    .text {
        transform: scale(0);
        transition: .3s transform ease-in-out;
        width: 50%;
    }
    img {
        max-width: 100%;
        max-height: 100%;
        transform: scale(.95);
        box-shadow: 0 5px 30px rgba($color: #000000, $alpha: .5);
    }
    textarea {
        width: 100%;
        height: 100%;
        border: none;
        max-width: 100%;
        max-height: 100%;
        padding: 25px;
        outline: none;
        font-size: inherit;
        color: $dark;
        line-height: inherit;
        font-weight: 300;
        background: linear-gradient($gray 50%, transparent 0) top;
        background-size: auto 4em;
        background-attachment: local;
        background-origin: content-box;
        border-left: 1px solid #eee;
        -webkit-overflow-scrolling: touch;
    }
    .close {
        position: absolute;
        left: 50%;
        bottom: 0;
        transform: translateX(-50%) translateY(110%);
        background: $main-color;
        color: #fff;
        width: 40px;
        height: 40px;
        font-size: 18px;
        border-radius: 50% 50% 0 0;
        text-align: center;
        line-height: 30px;
        cursor: pointer;
        transition: .2s transform ease-in-out;
        transition-delay: .5s;
        border: 5px solid #fff;
        border-bottom: 0;
        &:hover {
            background-color: lighten($color: $main-color, $amount: 20);
        }
    }

    &.show {
        pointer-events: auto;
        .img,
        .text {
            transform: scale(1);
        }
        .close {
            transform: translateX(-50%) translateY(0);
        }
        img {
            display: block;
        }
    }
}
@media screen and (max-width: 414px) {
    main {
        &::before {
            content: 'Click Here';
            font-size: 30px;
        }
    }
    .content {
        .img {
            display: none;
        }
        textarea {
            background: #fff;
        }
    }
}
#setting-switch {
    display: none;
}
#setting-switch:checked {
    & + label {
        transform: rotate(180deg) scale(1.2);

        & + .setting-cover {
            transform: translateX(-100%);
            + label {
                transform: translateX(0);
            }
        }
    }
}
label.setting-switch {
    display: inline-block;
    opacity: .2;
    transition: .2s transform ease-in-out;
    padding: 10px;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 3;
    img {
        width: 30px;
        height: 30px;
        display: block;
    }
    &:hover {
        opacity: .4;
    }
}
.setting-cover {
    position: fixed;
    left: 100%;
    top: 0;
    width: 100%;
    height: 100%;
    transition: .2s transform ease-in-out;
    padding: 60px 10px;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    // display: none;
    .setting {
        background: darken($color: $main-color, $amount: 10);
        width: 100%;
        max-width: 600px;
        margin: 0 auto;
        // height: 100%;
        padding: 20px;
        border-radius: 5px;
        color: $gray;
        font-weight: 300;
    }
    label {
        color: #1f8cfc;
        background: rgba(0, 0, 0, 0.3);
        padding: 10px 20px;
    }
    
    .cover {
        display: flex;
        align-items: stretch;
        margin-bottom: 10px;
        border-radius: 5px; 
        overflow: hidden;
        &:last-child {
            margin-bottom: 0;
        }
        & > label,
        & > button,
        & > .btn {
            border-right: 1px solid rgba($color: #000, $alpha: .1);
        }
        & > *:last-child {
            border-right: none;
        }
    }
    input {
        border: none;
        padding: 10px 10px;
        font-size: 12px;
        background-color: rgba($color: #000, $alpha: .2);
        outline: none;
        color: lighten($color: $main-color, $amount: 20);
        border-radius: 0;
        flex: 1;
    }
}
@media screen and (max-width: 414px) {
    button,
    a.btn,
    input[type=button] {
        font-size: 12px;
    }
    .setting {
        .cover {
            label:first-of-type {
                display: none;
            }
        }
    }
}


.alert {
    position: fixed;
    max-width: 100%;
    background: #1ec577;
    color: rgba($color: #fff, $alpha: .8);
    padding: 5px 20px;
    left: 50%;
    top: 0;
    transform: translate(-50%, -100%);
    transition: .2s transform ease-in-out;
    border-radius: 0 0 5px 5px;
    z-index: 99999;
    &.show {
        transform: translate(-50%, 0);
    }
}

#loading {
    position: fixed;
    top: 0;
    left: 0;
    height: .5vh;
    width: 100%;
    background: #ffad31;
    animation: 1s loading ease-in-out infinite;
    display: none;
}
#loading.show {
    display: block;
}
@keyframes loading {
    0% {
        opacity: 0;
        transform-origin: left;
        transform: scaleX(0);
    }
    40% {
        opacity: 1;
        transform-origin: left;
        transform: scaleX(1);
    }
    60% {
        opacity: 1;
        transform-origin: right;
        transform: scaleX(1);
    }
    100% {
        opacity: 0;
        transform-origin: right;
        transform: scaleX(0);
    }
}